Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parquet: Cache codecs by name and level #8182

Merged
merged 4 commits into from
Aug 1, 2023

Conversation

bryanck
Copy link
Contributor

@bryanck bryanck commented Jul 29, 2023

Currently when Parquet caches codecs, it does so by name but does not include the level. The can cause a problem if the level changes between writes in the same process. For example, table A is set to zstd-9, and a new insert occurs. Parquet has now cached zstd as the zstd with level 9 config. In the same process, Table B is set to zstd-3 and a new insert occurs. Parquet will look up the codec in its cache by name only, and return the zstd codec with level 9 set. So table B will be written to using zstd-9 instead of zstd-3.

This PR adds a workaround to include the level when caching codecs during writes so the codec with the correct level will be returned. Ultimately this should be fixed in Parquet and a PR is planned for that, though this PR allows this fix to get in sooner rather than later.

Copy link
Contributor

@nastra nastra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @bryanck for fixing this and thanks @Fokko for reviewing

@nastra nastra merged commit 3bfb2b2 into apache:master Aug 1, 2023
41 checks passed
nastra pushed a commit to nastra/iceberg that referenced this pull request Aug 15, 2023
* Spark: Update antlr4 to match Spark 3.4 (apache#7824)

* Parquet: Revert workaround for resource usage with zstd (apache#7834)

* GCP: fix single byte read in GCSInputStream (apache#8071)

* GCP: fix byte read in GCSInputStream

* add test

* Parquet: Cache codecs by name and level (apache#8182)

* GCP: Add prefix and bulk operations to GCSFileIO (apache#8168)

* AWS, GCS: Allow access to underlying storage client (apache#8208)

* spotless
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants